Skip to content

[pull] main from bazel-contrib:main#551

Merged
pull[bot] merged 2 commits intogarymm:mainfrom
bazel-contrib:main
Mar 16, 2026
Merged

[pull] main from bazel-contrib:main#551
pull[bot] merged 2 commits intogarymm:mainfrom
bazel-contrib:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Mar 16, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

faximan and others added 2 commits March 16, 2026 00:51
…es (#3636)

This fixes #3563.
Verified by running the repro in
https://github.com/mering/reproduction_rules_python_1_7.

The identified regression in
b8e32c4
is problematic because prepending `ctx.workspace_name` to `short_path`
results in paths containing `..` (e.g., `_main/../sub+/path/to/file.py`)
when building from a root module that includes other modules. This
causes the `_find_runfiles_root`
[logic](https://github.com/faximan/rules_python/blob/eb6ac472eb86cc263acc336a2b73982043069aae/python/private/site_init_template.py#L73),
which _counts slashes_, to incorrectly calculate the runfiles root.

The fix is simply using the available `runfiles_root_path` function
instead. In the example above, this makes the path simply
`sub+/path/to/file.py`.

---------

Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
This uses snake_case function names in the system python bootstrap. This
is just to
modernize the code a bit.

Along the way ...
* Add some additional debug logging
* Fix the `if is_windows:` conditional that was always executing
(because it was
  referring to a function), but a no-op, on Linux.
@pull pull Bot added the ⤵️ pull label Mar 16, 2026
@pull pull Bot merged commit eb1ae41 into garymm:main Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants